home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Icon / c / GetDouble < prev    next >
Text File  |  1995-07-08  |  495b  |  23 lines

  1. #include <stdlib.h>
  2.  
  3. #include "DeskLib:Wimp.h"
  4. #include "DeskLib:WimpSWIs.h"
  5. #include "DeskLib:Icon.h"
  6.  
  7.  
  8.  
  9. extern double Icon_GetDouble(window_handle w, icon_handle i)
  10. /*
  11.  * Gets the given icon's text and returns it in the form of an integer
  12.  * numeric value. 0 will be returned from any error/invalid text
  13.  */
  14. {
  15.   icon_block istate;
  16.  
  17.   Wimp_GetIconState(w, i, &istate);
  18.   if (istate.flags.value & (icon_TEXT | icon_INDIRECTED))
  19.     return(atof(istate.data.indirecttext.buffer));
  20.  
  21.   return(0);
  22. }
  23.